package com.ll.spring5.aopanno;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 2020/9/9 - 14:13
 */
@Component
@Aspect
@Order(1)
public class Personproxy {

    //前置通知
    //@Before(value="execution(* com.ll.spring5.aopanno.User.add(..))")
    @Before(value="execution(* com.ll.spring5.aopanno.User.add(..))")
    public void before() {
        System.out.println("PersonproxyBefore()......");
    }

    //方法执行之后执行,不管是否发生异常,都会执行
    //最终通知
    @After(value="execution(* com.ll.spring5.aopanno.User.add(..))")
    public void after() {
        System.out.println("PersonproxyAfter()...");
    }
}
